﻿using DC2010.Objects.Data;

namespace DC2012
{
    public partial class CoreEditor
    {
        private void ConstructInterface()
        {
            Helper_AddTile(0, 0, "TILE_WALL",TileType.Wall, "Wall do not have to be placed.");
            Helper_AddTile(31, 1, "TILE_FLOOR",TileType.Floor ,"");
            Helper_AddTile(1, 2, "TILE_PIT", TileType.Pit, "");
            Helper_AddTile(2, 3, "TILE_UNK", TileType.None, "");
            Helper_AddTile(3, 4, "TILE_STAIRS_UP_SOUTH", TileType.Stairs, "");
            Helper_AddTile(12, 5, "TILE_STAIRS_DOWN_NORTH", TileType.Stairs, "");
            Helper_AddTile(13, 6, "TILE_TELEPORT", TileType.Teleport, "");
            Helper_AddTile(14, 7, "TILE_PRESSURE_PAD_SMALL", TileType.PressPadSmall, "");
            Helper_AddTile(10, 8, "TILE_PRESSURE_PAD_BIG", TileType.PressPadBig, "");
            Helper_AddTile(18, 9, "TILE_ILLUSION_WALL", TileType.IllusionWall, "");
            Helper_AddTile(15, 10, "TILE_TURN_LEFT", TileType.TurnLeft, "");
            Helper_AddTile(16, 11, "TILE_TURN_RIGHT", TileType.TurnRight, "");
            Helper_AddTile(17, 12, "TILE_TURN_OPPOSITE", TileType.TurnOposite, "");
            Helper_AddTile(22, 13, "TILE_GENERATOR", TileType.Generator, "");
            Helper_AddTile(25, 14, "TILE_BLOCKER", TileType.Blocker, "");
            Helper_AddTile(11, 15, "TILE_SWITCH_WALL", TileType.SwitchWall, "");


            Helper_AddTile(24, 16, "TILE_GRATE_SQUARE", TileType.Grate, "");
            //Helper_AddTile(26, 17, "TILE_GRATE_CIRCLE", TileType.FloorDecoration, "");

            //Helper_AddTile(4, 18, "TILE_GATE_BUTTONS_SOUTH", TileType.Door, "");
            Helper_AddTile(5, 19, "TILE_WOODEN_GATE", TileType.Door, "");
            //Helper_AddTile(6, 20, "TILE_GATE_SOUTH", TileType.Door, "");

            Helper_AddTile(7, 21, "TILE_FOUNTAIN", TileType.WallDecorationFountain, "");
            Helper_AddTile(21, 22, "TILE_BUTTON", TileType.Button, "");
            Helper_AddTile(9, 23, "TILE_DECORATION", TileType.WallDecorationSmall, "");
            Helper_AddTile(19, 24, "TILE_ALCOVE", TileType.Alcove, "");
            Helper_AddTile(20, 25, "TILE_DECORATION_SMALL", TileType.WallDecorationBig, "");
            //Helper_AddTile(21, 26, "TILE_MIRROR_SOUTH", TileType.WallDecoration, "");
            //Helper_AddTile(27, 27, "TILE_BUTTON_GREEN_SOUTH", TileType.Button, "");
            Helper_AddTile(28, 27, "TILE_FIRE_THROWER", TileType.FlameThrower, "");
            Helper_AddTile(30, 28, "TILE_RESURRECTION", TileType.Ressurection, "");
        }

        private void Helper_AddTile(int spriteIndex, int editorIndex, string tileId, TileType tt, string comment)
        {
            int originX = 0;
            int originY = 0;

            DCAnimatedSprite sx = Neocortex.I.GetSubFrame("TILESET", tileId, spriteIndex);
            sx.X = originX + 10;
            sx.Y = originY + 10 + editorIndex * 18;
            sx.Id = tileId;
            sx.Comment = comment;
            sx.TileType = tt;
            sx.Code = tileId;


            DisplayText(sx.X + 32, sx.Y+2, sx.Id.Replace("TILE_","").Replace("_SOUTH", ""), txtColl2);
            AddSprite(sx, gameinterface);

        }
    }
}
